<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    //this指向
    // var name = '校长',
    //   age = 18
    // var obj = {
    //   //<----
    //   name: '小王',
    //   objage: this.age,
    //   myfun: function () {
    //     //<-----
    //     console.log(this.name + '年龄' + this.age)
    //   },
    // }
    // var db = {
    //   name: '盖伦',
    //   age: 88,
    // }
    // console.log(obj.myfun.bind(db))
    //原型对象
    // var arr = [1, 2, 34]
    // console.log(arr)

    // function Person(first, last, age, eyecolor) {
    //   this.firstName = first
    //   this.lastName = last
    //   this.age = age
    //   this.eyeColor = eyecolor
    // }

    // Person.prototype.name = function () {
    //   return this.firstName + ' ' + this.lastName
    // }
    // Person.prototype.work = function () {
    //   return this.firstName + ' ' + this.lastName + '是演员'
    // }
    // var obj = new Person('张', '国立', '66', 'red')
    // console.log(obj.work())

    var name = '张三'
    var str = '123'
    function Person() {
      this.name = 99
    }

    var person1 = new Person() // 9
    console.log(person1.name)
    console.log([1, 2, 3])

    console.log(window.Array.prototype)
  </script>
</html>
